<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>攻略类型小类管理</title>
	<%@ include file="/view/common/tags.jsp"%>
	<script type="text/javascript" src="${sysManagerV1}/js/My97DatePicker/WdatePicker.js"> </script>
</head>
<body>
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<div class="box">
				<div class="box-body">
					<div class="panel panel-default">
						<div class="panel-body" style="padding-bottom:5px;">
							<form class="form-horizontal" action="" method="post" id="dataForm">
								<input type="hidden" id="parentId" name="wm[PARENT_ID]" value='<%=request.getParameter("parentId")%>'>
								<input type="hidden" id="gameId" name="wm[GAME_ID]" value=''>
								<div class="searchMenu">
									<div>
										<label>游戏名称：</label><label id="gameName" style="color:#f00;font-weight:bold;"></label>
										<label>攻略类型：</label><label id="raiderTypeBig" style="color:#f00;font-weight:bold;"></label>
									</div>
									<div>
										<label style="width: 120px;">攻略小类名称：</label>
										<input type="text" class="form-control" name="wm[_LIKE$RAIDER_TYPE]" value="${page.wm._LIKE$RAIDER_TYPE}"  placeholder="请输入攻略类型名称">
									</div>
									<div>
										<label>选择状态：</label>
										<sk:select cssClass="form-control select" name="wm[OPEN_FLAG]" value="${page.wm.OPEN_FLAG}" >
											<option value="">请选择</option>
											<option value="0">停用</option>
											<option value="1">启用</option>
										</sk:select>
									</div>
									<div>
										<label>操作时间：</label>
										<input id="optTimeStart" name="wm[_MORE_EQUAL$OPT_TIME]" value="${page.wm._MORE_EQUAL$OPT_TIME}"  type="text"  class="Wdate"
											   onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 00:00:00',alwaysUseStartDate:true,maxDate:'#F{$dp.$D(\'optTimeEnd\')}',minDate:'#F{$dp.$D(\'optTimeEnd\',{d:-30,H:-23,m:-59,s:-59})}'})" />
										<span class="pull-left">&nbsp;-&nbsp;</span>
										<input id="optTimeEnd" name="wm[_LESS_EQUAL$OPT_TIME]" value="${page.wm._LESS_EQUAL$OPT_TIME}"  class="Wdate"
											   onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 23:59:59',alwaysUseStartDate:true,minDate:'#F{$dp.$D(\'optTimeStart\')}',maxDate:'#F{$dp.$D(\'optTimeStart\',{d:+30,H:+23,m:+59,s:+59})}'})" />
									</div>
									<div class="mal10" >
										<button type="button"  class="btn btn-primary btn-sm"  onclick="goBack()"><span class='glyphicon glyphicon-backward'></span>返&nbsp;回</button>
										<button type="button"  class="btn btn-primary btn-sm"  onclick="findData()"><span class='glyphicon glyphicon-search'></span>查&nbsp;询</button>
										<c:set var="parentId" value='<%=request.getParameter("parentId")%>'/>
										<sk:button type="button"  rightKey="20170816153247"  _class="btn btn-success btn-sm"  onclick="add('${parentId}')"><span class='glyphicon glyphicon-plus'></span>添&nbsp;加</sk:button>
									</div>
								</div>
							</form>
						</div>
					</div>
					<table class="table table-hover table-condensed table-bordered table-striped" id="dataTable" >
						<thead>
						<tr>
							<th data-field="index" data-align="center" data-formatter="indexFormatter" data-sortable="false">序号</th>
							<th data-field="raiderType" data-align="center" data-sortable="true">攻略小类</th>
							<th data-field="orderByNo" data-align="center" data-sortable="true">排序号</th>
							<th data-field="openFlag" data-align="center" data-formatter="useFlagFormatter" data-sortable="true">状态</th>
							<th data-field="optAccount" data-align="center" data-sortable="true" >操作人帐号</th>
							<th data-field="optTime" data-align="center" data-formatter="timeFormatter_point" data-sortable="true">操作时间</th>
							<th data-field="deleteButton" data-align="center" data-formatter="buttonFormatter" data-sortable="false">操作</th>
						</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>
</section>
<%@ include file="/view/common/footer.jsp"%>
<script type="text/javascript" src="${sysManagerV1}/view/js/strategy/strategyType_list.js"></script>
</body>
<script>
    // 提示信息
    var msgg='<%=request.getAttribute("msg")%>';
    if (msgg && msgg!=null && msgg!='null') {
        layer.msg(msgg);
    }
    var parentId = $("#parentId").val();
    function buttonFormatter(value, row, index) {
        var caozuo1 = "<button id='btn_edit' type='button' onclick='_update("+row.rowId+","+parentId+");'  class='btn btn-default btn-sm'><span class='glyphicon glyphicon-pencil'></span>修 改</button>";
        //var caozuo2 = "<button id='btn_edit' type='button' onclick='deleteRaiderType("+row.rowId+", "+row.openFlag+");'  class='btn btn-default btn-sm'><span class='glyphicon glyphicon-remove'></span>&nbsp;删&nbsp;除&nbsp;</button>";
        return caozuo1;
    }
    // 加载table 数据
    $(function(){
        $("#dataTable").bootstrapTable({
            url: JSSTRATEGYV1 + "/raiderType/getRaiderTypeList",
            method:"get",
            contentType: "application/x-www-form-urlencoded",
            pagination:true,
            sidePagination:"server",
            queryParams: function(params) {
                return $.extend({}, params, parseJson(decodeURIComponent($("#dataForm").serialize())));
            }
        });
    });
    $(function(){
        if (CheckUtil.isNotNull(parentId) && parseInt(parentId) > 0) {
            $.ajax({
                url: JSSTRATEGYV1 + "/raiderType/getRaiderTypeInfo",
                type: "post",
                cache: false,
                data:{"rowId":parentId},
                dataType:"json",
                async:false,
                success: function(data) {
                    if (data == null) {
                        return;
                    }
                    $("#gameId").val(data.gameId);
                    $("#gameName").html(data.gameName);
                    $("#raiderTypeBig").html(data.raiderType);
                }
            });
        }
    });
    //返回维护区服页面
    function goBack(){
        window.location.href="${sysManagerV1}/raiderType/getRaiderTypeList";
    }
</script>
</html>